#include <iostream>
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>

int main(int argc, char* argv[])
{
    if(argc != 3)
    {
        perror(argv[0]);
        exit(1);
    }

    // ./XXX.exe kill -9 pid
    int signumber = std::stoi(argv[2]);
    pid_t id = std::stoi(argv[3]);
    int n = ::kill(id, signumber);
    if(n < 0)
    {
        perror("Kill fail!");
        exit(-1);
    }
    std::cout << "Kill success!" << std::endl;
    return 0;
}